<tr><td align="right" valign="top" class='normal' colspan=4> &nbsp;</td></tr>
                                                <tr><td align="right" valign="top" class='header2' colspan=4> &nbsp;</td>
                                                 <tr><td align="right" valign="top" class='normal' colspan=4> &nbsp;</td></tr>
                                                <!--// end of the motorized permit information //-->
<?php
if ($itemID_==1221) {
	$linkval='PAYMENT';
} else {
	$linkval='RELEASING';
}

if ($permit_type=='Fishery') {
	$subn='subfish';
} else {
	$subn='PRO';
}

if ($boton==1) {
	$bbb = 'button';
	$jaba = 'onclick="javascript:validate_();"';
} else {
	$bbb = 'submit';
	$jaba = '';
}

if ($permit_type=='Franchise' || $permit_type=='Motorized') {
		$jaba ="onclick='_FRM.addveh.value=2;'";
}


if ($fpay==1 ||  $ulev==6 || $ulev==7) {
	$haveperm = 1;
}

if ($fpar==1 ||  $ulev==6 || $ulev==7) {
	 $haveperm = 1;
}

if ($ipay==1 ||  $ulev==6 || $ulev==7) {
	 $haveperm = 1;
}

if ($ipar==1 ||  $ulev==6 || $ulev==7) {
	 $haveperm = 1;
}

if ($mpay==1 ||  $ulev==6 || $ulev==7) {
	 $haveperm = 1;
}

if ($mpar==1 ||  $ulev==6 || $ulev==7) {
	 $haveperm = 1;
}

if ($opay==1 ||  $ulev==6 || $ulev==7) {
	 $haveperm = 1;
}

if ($opar==1 ||  $ulev==6 || $ulev==7) {
	 $haveperm = 1;
}

if ($ppar==1 ||  $ulev==6 || $ulev==7) {
	 $haveperm = 1;
}

if ($busItem=='Occupational' and $itemID_=='1221') {
	$canlink="parent.location='index.php?part=4&class_type=Permits&itemID_=1221&permit_type=Occupational&busItem=Occupational&mtopsearch=SEARCH';";
} elseif ($busItem=='Motorized' and $itemID_=='1221') {
	$canlink="parent.location='index.php?part=4&class_type=Permits&itemID_=1221&permit_type=Motorized&busItem=Motorized&mtopsearch=SEARCH';";
} elseif ($busItem=='Franchise' and $itemID_=='1221') {
        $canlink="parent.location='index.php?part=4&class_type=Permits&itemID_=1221&permit_type=Franchise&busItem=Franchise&mtopsearch=SEARCH';";
} elseif ($busItem=='Peddlers' and $itemID_=='1221') {
        $canlink="parent.location='index.php?part=4&class_type=Permits&itemID_=1221&permit_type=Peddlers&busItem=Peddlers&mtopsearch=SEARCH';";
} elseif ($busItem=='Fishery' and $itemID_=='1221') {
        $canlink="parent.location='index.php?part=4&class_type=Permits&itemID_=1221&permit_type=Fishery&busItem=Fishery&mtopsearch=SEARCH';";
} elseif ($busItem=='Occupational' and $itemID_=='2212') {
        $canlink="parent.location='index.php?part=4&class_type=Permits&itemID_=2212&permit_type=Occupational&busItem=Occupational&mtopsearch=SEARCH';";
} elseif ($busItem=='Motorized' and $itemID_=='2212') {
        $canlink="parent.location='index.php?part=4&class_type=Permits&itemID_=2212&permit_type=Motorized&busItem=Motorized&mtopsearch=SEARCH';";
} elseif ($busItem=='Franchise' and $itemID_=='2212') {
        $canlink="parent.location='index.php?part=4&class_type=Permits&itemID_=2212&permit_type=Franchise&busItem=Franchise&mtopsearch=SEARCH';";
} elseif ($busItem=='Peddlers' and $itemID_=='2212') {
        $canlink="parent.location='index.php?part=4&class_type=Permits&itemID_=2212&permit_type=Peddlers&busItem=Peddlers&mtopsearch=SEARCH';";
} elseif ($busItem=='Fishery' and $itemID_=='2212') {
        $canlink="parent.location='index.php?part=4&class_type=Permits&itemID_=2212&permit_type=Fishery&busItem=Fishery&mtopsearch=SEARCH';";
}
if ($noappa == "" || $noappa <= 0) {
?>
                                                <tr>
                                                                <td align="center" valign="top" class='normal' colspan=4>
                                                                                &nbsp;<input type='hidden' name='<?php echo $subn; ?>' value='PROCESS'>
																				&nbsp;<input type='hidden' name='PROCESS' value='PROCESS'>
				<?
				if ($permit_type == "Occupational") {
				?>
                &nbsp; <input type='button' name='PROCESS123'  value='SAVE' onClick="javascript: OccuAdd();"> 
				<?
				} elseif ($permit_type == "Peddlers") {
				?>
				&nbsp; <input type='button' name='PROCESS123'  value='SAVE' onClick="javascript: PeddAdd();"> 
				<?
				} else {
				?>
				<input type='<?php echo $bbb; ?>' name='PROCESS' value='SAVE' <?php echo $jaba; ?> >
				<?
				}
				?>
<input type=button  value=CANCEL onClick="<?php echo $canlink; ?>">

<?php 
//if ($itemID_<>2212) {
?>
<input type='button' name='printrec' value='PRINT' onClick='javascript:AppRec("<?php echo $owner_id; ?>","<?php echo $permit_type; ?>", "<?php echo $stat; ?>");' >
<?php
//}

if ($haveperm==1 and $linkval=='PAYMENT') {
?>
<input type=submit name=linkpro  value=<?php echo $linkval; ?>>
<?php
}


if ($haveperm==1 and $linkval=='RELEASING') {
//if ($haveperm==1 and $totalpaid[0]>0 and $linkval=='RELEASING') {
?>
<input type=submit name=linkpro  value=<?php echo $linkval; ?>>
<?php
}
}
?>


<script language='Javascript' src='javascripts/default.js'></script>
<script language='Javascript'>
function OccuAdd()
{
	var _FRM = document._FRM;
	if (_FRM.pos_app.value == "") {
		alert("Enter Valid Position!!");
		_FRM.pos_app.focus();
		return false;
	}
	if (_FRM.pos_app.value.length > 30) {
		alert("Position Exceeds Max Length!!");
		_FRM.pos_app.focus();
		return false;
	}
	if (_FRM.employer_business.value == "") {
		alert("Enter Valid Employer!!");
		_FRM.employer_business.focus();
		return false;
	}
	if (_FRM.owner_id.value == "") {
		alert("Cannot Save! No Owner!!");
		return false;
	}
	_FRM.PROCESS.value = "SAVE";
	_FRM.submit();
	return true;
}
function PeddAdd()
{
	var _FRM = document._FRM;
	if (isBlank(_FRM.peddler_bus.value)) {
		alert("Enter Valid Business!!");
		_FRM.peddler_bus.focus();
		_FRM.peddler_bus.select();
		return false;
	}
	if (_FRM.peddler_bus.value.length > 30) {
		alert("Business Exceeds Max Length!!");
		_FRM.peddler_bus.focus();
		_FRM.peddler_bus.select();
		return false;
	}
	if (isBlank(_FRM.merchandise.value)) {
		alert("Enter Valid Merchandise Sold!!");
		_FRM.merchandise.focus();
		_FRM.merchandise.select();
		return false;
	}
	if (_FRM.merchandise.value.length > 30) {
		alert("Merchandise Sold Exceeds Max Length!!");
		_FRM.merchandise.focus();
		_FRM.merchandise.select();
		return false;
	}
	if (_FRM.owner_id.value == "") {
		alert("Cannot Save! No Owner!!");
		return false;
	}
	_FRM.PROCESS.value = "SAVE";
	_FRM.submit();
	return true;
}
function AppRec(x, y, z)
{
                                                                                                 
winpopup = window.open('appoth.php?owner_id=' + x + '&permit_type=' + y + '&stat=' + z + '&nfishfee=<? echo $nfishfee;?>&itemID_=<? echo $itemID_;?>&noappa=3');
//, 'width=300, height=300,toolbar=0,location=0,directories=0,menubar=0,resizable=0,scrollbars=1,status=1'");
}
</script>


<!--                                                                                &nbsp;<input type='reset'  value='R E S E T' >-->
                                                                </td>
                                                </tr>

                                </table>
                                </form>
                        </td>
                </tr>

                <tr><td align="center" valign="center" class='header' height=10></td></tr>
</table>
</form>
</div>
